<div style="padding-bottom:5px;"><label style='color:#FF9900; font-weight:bold;'><?php echo $this->numProduct;?></label> <?php echo $this->translator('search_guide');?> "<label style='color:#FF9900; font-weight:bold;'><?php echo $this->exp['keyword'];?></label>"</div>
<?php if($this->numProduct > 0):?>
<?php $i=0; foreach ($this->products as $product):?>
<?php
    /**
    * Check image exist directory
    **/
	if($product->product_image){
		$arr  = explode(',',$product->product_image);
		$file = $arr[0]; 
		$path = str_replace($this->APP_STATIC_SERVER,getcwd(),$file);
		$file = Tomato_Helper_Helper::checkFile($path, $file, '_thumbnail');
	}
	$urlImage = $file?$file:null;
    /**
    * Category follow product
    **/
    $objCategory = $this->arrPC[$product->product_id];

    /**
    * Enterprise follow product
    **/
    $objEnterprise = $this->arrPE[$product->product_id];

    /**
    * Param url detail
    **/
    $arrRouteDetail = array(
        'enterprise_id' => $objEnterprise->id,
        'enterprise_name' => Tomato_Utility_String::removeSign($objEnterprise->company_name_en, '-', true),
        'cat' => $objCategory->category_id,
        'slug' => ($objCategory->slug)?$objCategory->slug:Tomato_Utility_String::removeSign($objCategory->category_admin_name, '-', true),
        'product_id' => $product->product_id,
        'pro_slug' => ($product->slug)?$product->slug:Tomato_Utility_String::removeSign($product->product_admin_name, '-', true),
    );
/**
 * code Hung them vao 
**/
	$coreQty = null;
	$quantity = null;
	if('non_deliver_able' == $product->product_status_of_delivery){
		$quantity = "<span style='color:red;'>".$this->translator("product_status_of_delivery_non_deliverable")."</span>";
		$coreQty = $product->product_status_of_delivery;
	}
	elseif('please_contact' == $product->product_status_of_delivery){
		$quantity = $this->translator("product_status_of_delivery_".$product->product_status_of_delivery);
		$coreQty = $product->product_status_of_delivery;
	}
	else{
		$quantity = ($product->product_quantity)?$product->product_quantity:"<span style='color:red;'>".$this->translator("product_status_of_delivery_non_deliverable")."</span>";
		$coreQty = $product->product_quantity_mode;
	}
/**
 * end code  
**/
?>
<?php if($i%2==0):?>
<div class="subrow">
<?php endif;?>
    <div class="<?php if($i%2==0):?>col_50l<?php else:?>col_50r<?php endif;?>">
        <div class="subcolumns_oldgecko">
            <a href="<?php echo $this->url($arrRouteDetail,'shop_product_detail');?>"><span class="title"><?php echo ($product->product_content_name)?$product->product_content_name:$product->product_admin_name;?></span></a>
        </div>
        <div class="subcolumns_oldgecko" style="padding-bottom:5px;">
            <div class="geckol" style="padding-right:5px;">
                <?php if($urlImage):?>
                    <a href="<?php echo $this->url($arrRouteDetail,'shop_product_detail');?>"><img class="item_img" width="95" src="<?php echo $urlImage;?>" /></a>
                <?php else:?>
                    <a href="<?php echo $this->url($arrRouteDetail,'shop_product_detail');?>"><img class="item_img" src="<?php echo $this->baseUrl(); ?>/skins/bizprofile/default/html/images/img.jpg" /></a>
                <?php endif;?>
            </div>
			<!--Hung sua:
				Muc dich:Cho an neu ko co du lieu do ve
			-->
            <div class="geckor">
                <div style="text-align:justify">
                    <?php echo strip_tags(Tomato_Helper_Helper::substring($product->product_content_description, 70));?>
                </div>
                <div>
                    <?php echo $this->translator('front_product_price');?>:
                    <strong><?php echo $product->product_price;?> <?php echo $product->product_price_currency;?></strong>
                </div>
				<?php if($product->product_shipping_price_1 > 0):?>
                <div style="width:50%; float:left;">
                    <i><?php echo $this->translator('front_product_shipping_price')?></i><br />
                    <strong><?php echo $product->product_shipping_price_1;?> <?php echo $product->product_price_currency;?></strong>
                </div>
				<?php endif;?>
				<!--
				<?php //if($product->product_quantity > 0):?>
                <div style="width:50%; float:left;">
                    <?php //echo $this->translator('front_product_source')?></i><br />
                    <strong><?php ///echo $product->product_quantity;?></strong> <?php// echo $this->translator('front_product_source_guide');?>
                </div>
				<?php// endif;?>
				-->
				<!--CODE Hung THEM VAO-->
				<?php if($coreQty != 'infinity'):?>
					<div style="width:50%; float:left;">
						<?php echo $this->translator('front_product_source')?></i><br />
						<strong><?php echo $quantity;?></strong>
					</div>	
				<?php endif;?>
				<!--KET THUC THEM VAO-->
            </div>
			<!--ket thuc code sua-->
        </div>
    </div>
<?php $i++; if($i%2==0):?>
</div>
<?php endif;?>
<?php endforeach;?>
<?php if($i%2!=0):?>
</div>
<?php endif;?>
<div class="ajax_paginator"><?php echo $this->paginator()->slide($this->paginator, $this->paginatorOptions);?></div>
<?php endif;?>

<script type="text/javascript">
$(document).ready(function() {
    $('.ajax_paginator span a').click(function(evt){
        evt.preventDefault();
        href = $(this).attr('href');
        ajaxLoad1(href);
    });
});

function ajaxLoad1(url){
    var keyword = '<?php echo isset($this->exp['keyword'])?$this->exp['keyword']:null;?>';
    var attribute_id = '<?php echo isset($this->exp['attribute_id'])?$this->exp['attribute_id']:'all';?>';
    var value = '<?php echo isset($this->exp['key_value'])?$this->exp['key_value']:null;?>';
    var category_id = '<?php echo isset($this->exp['category_id'])?$this->exp['category_id']:'all'?>';
    var strPId = '<?php echo isset($this->exp['strPId'])?$this->exp['strPId']:null;?>';

    http = 'http://'+'<?php echo $_SERVER['HTTP_HOST'];?>';
    route = http+url;
    $("#outputResult").html('').addClass('t_a_ui_helper_loading');
    jQuery.ajaxq('product', {
        type: 'POST',
        url: route,
        data: { keyword:keyword, attribute_id:attribute_id, value:value, category_id:category_id, strPId:strPId },
        success: function(html) {
            $("#outputResult").html('').removeClass('t_a_ui_helper_loading');
            $('#outputResult').html(html);
        }
    });
}
</script>